#include "avz.h"

using namespace AvZ;

void Script()
{
    SetZombies({ZOMBIE,
        POLE_VAULTING_ZOMBIE,
        FOOTBALL_ZOMBIE,
        DANCING_ZOMBIE,
        ZOMBONI,
        JACK_IN_THE_BOX_ZOMBIE,
        DIGGER_ZOMBIE,
        POGO_ZOMBIE,
        BUNGEE_ZOMBIE,
        LADDER_ZOMBIE,
        CATAPULT_ZOMBIE,
        GARGANTUAR,
        GIGA_GARGANTUAR});

    SelectCards({
        ICE_SHROOM,
        M_ICE_SHROOM,
        COFFEE_BEAN,
        CHERRY_BOMB,
        PUFF_SHROOM,
        SUN_SHROOM,
    });

    SetTime(-599, 1);
    pao_operator.resetPaoList({
        {1, 1},
        {3, 1},
        {5, 1},
        {1, 5},
        {2, 5},
        {3, 5},
        {4, 5},
        {5, 5},
    });

    ice_filler.start({{2, 1}, {4, 1}, {1, 7}});
    SetTime(-200, 2);
    ice_filler.resetFillList({{2, 1}, {4, 1}});
    SetTime(-200, 9);
    ice_filler.resetFillList({{2, 1}, {4, 1}, {1, 7}});
    SetTime(-200, 11);
    ice_filler.resetFillList({{2, 1}, {4, 1}});

    for (auto wave : {1, 4, 7, 12, 15, 18}) {
        // PP
        SetTime(-95, wave);
        pao_operator.pao({{2, 9}, {4, 9}});
        SetTime(602 - 100 - 198);
        ice_filler.coffee();
    }

    for (auto wave : {2, 5, 8, 13, 16}) {
        // I-PP
        SetTime(1237 - 373, wave);
        pao_operator.pao({{2, 8.75}, {4, 8.75}});
        SetTime(1438 - 100 - 198);
        ice_filler.coffee();
    }

    for (auto wave : {3, 6, 11, 14, 17}) {
        // IBB-PP
        SetTime(-95, wave);
        pao_operator.pao({{2, 7.8}, {4, 7.8}});
        SetTime(1237 - 373);
        pao_operator.pao({{2, 8.575}, {4, 8.575}});
    }

    for (auto wave : {10}) {
        // PP+A
        SetTime(-55, wave);
        pao_operator.pao({{2, 9}, {4, 9}});
        SetTime(301);
        Card(CHERRY_BOMB, 2, 9);
        SetTime(602 - 100 - 198);
        ice_filler.coffee();
    }

    for (auto wave : {9}) {
        // IBB-PP
        SetTime(-95, wave);
        pao_operator.pao({{2, 9}, {4, 9}});
        SetTime(1237 - 373);
        pao_operator.pao({{2, 8.575}, {4, 8.575}});
        pao_operator.recoverPao({{2, 9}, {4, 9}});
    }

    for (auto wave : {19}) {
        // I-PP…
        SetTime(1237 - 373, wave);
        pao_operator.pao({{2, 8.75}, {4, 8.75}});
        SetTime(1438 - 100 - 198);
        ice_filler.coffee();
        pao_operator.recoverPao({{2, 8}, {4, 8}});
    }

    for (auto wave : {20}) {
        SetTime(-55, wave);
        pao_operator.pao({{2, 9}, {4, 9}});
        SetTime(394 - 100 - 198);
        ice_filler.coffee();
    }
}